package com.nuumoblie.bluetoothtools.ble.db.entity;

import java.util.List;
import java.util.UUID;

public class BleAdvertiseInfo {

    private int _id;
    private int mManufacturerId;
    private String mManufacturerValue;
    private boolean mIsIncludeTxPowerLevel;
    private boolean mIsIncludeDeviceName;
    private int mTxPowerLevel;
    private int mAdvertiseMode;
    private boolean mConnectable;
    private int mTimeout;
    private List<ServiceInfo> mServiceInfos;

    public int get_id() {
        return _id;
    }

    public void set_id(int _id) {
        this._id = _id;
    }

    public int getManufacturerId() {
        return mManufacturerId;
    }

    public void setManufacturerId(int mManufacturerId) {
        this.mManufacturerId = mManufacturerId;
    }

    public String getManufacturerValue() {
        return mManufacturerValue;
    }

    public void setManufacturerValue(String mManufacturerValue) {
        this.mManufacturerValue = mManufacturerValue;
    }

    public boolean isIsIncludeTxPowerLevel() {
        return mIsIncludeTxPowerLevel;
    }

    public void setIsIncludeTxPowerLevel(boolean mIsIncludeTxPowerLevel) {
        this.mIsIncludeTxPowerLevel = mIsIncludeTxPowerLevel;
    }

    public boolean isIsIncludeDeviceName() {
        return mIsIncludeDeviceName;
    }

    public void setIsIncludeDeviceName(boolean mIsIncludeDeviceName) {
        this.mIsIncludeDeviceName = mIsIncludeDeviceName;
    }

    public int getTxPowerLevel() {
        return mTxPowerLevel;
    }

    public void setTxPowerLevel(int mTxPowerLevel) {
        this.mTxPowerLevel = mTxPowerLevel;
    }

    public int getAdvertiseMode() {
        return mAdvertiseMode;
    }

    public void setAdvertiseMode(int mAdvertiseMode) {
        this.mAdvertiseMode = mAdvertiseMode;
    }

    public boolean isConnectable() {
        return mConnectable;
    }

    public void setConnectable(boolean mConnectable) {
        this.mConnectable = mConnectable;
    }

    public int getTimeout() {
        return mTimeout;
    }

    public void setTimeout(int mTimeout) {
        this.mTimeout = mTimeout;
    }

    public List<ServiceInfo> getServiceInfos() {
        return mServiceInfos;
    }

    public void setServiceInfos(List<ServiceInfo> mServiceInfos) {
        this.mServiceInfos = mServiceInfos;
    }

    public static class ServiceInfo {
        private int _id;
        private int mProductId;
        private UUID mUuid;
        private String mValue;
        private int mServiceType;
        private int mWriteType;
        private List<CharacteristicInfo> mCharacteristicInfos;

        public int get_id() {
            return _id;
        }

        public void set_id(int _id) {
            this._id = _id;
        }

        public int getProductId() {
            return mProductId;
        }

        public void setProductId(int mProductId) {
            this.mProductId = mProductId;
        }

        public UUID getUuid() {
            return mUuid;
        }

        public void setUuid(UUID mUuid) {
            this.mUuid = mUuid;
        }

        public String getValue() {
            return mValue;
        }

        public void setValue(String mValue) {
            this.mValue = mValue;
        }

        public int getServiceType() {
            return mServiceType;
        }

        public void setServiceType(int mServiceType) {
            this.mServiceType = mServiceType;
        }

        public int getWriteType() {
            return mWriteType;
        }

        public void setWriteType(int mWriteType) {
            this.mWriteType = mWriteType;
        }

        public List<CharacteristicInfo> getCharacteristicInfos() {
            return mCharacteristicInfos;
        }

        public void setCharacteristicInfos(List<CharacteristicInfo> mCharacteristicInfos) {
            this.mCharacteristicInfos = mCharacteristicInfos;
        }
        public void setService(BleServiceEntity entity){
            this._id = entity.get_id();
            this.mProductId = entity.getProductId();
            this.mServiceType = entity.getServiceType();
            this.mUuid = entity.getUuid();
            this.mValue = entity.getValue();
            this.mWriteType = entity.getWriteType();
        }
    }

    public static class CharacteristicInfo {
        private int _id;
        private int mServiceId;
        private UUID mUuid;
        private String mValue;
        private int mPermission;
        private int mWriteType;
        private List<DescriptorInfo> mDescriptorInfos;

        public int get_id() {
            return _id;
        }

        public void set_id(int _id) {
            this._id = _id;
        }

        public int getServiceId() {
            return mServiceId;
        }

        public void setServiceId(int mServiceId) {
            this.mServiceId = mServiceId;
        }

        public UUID getUuid() {
            return mUuid;
        }

        public void setUuid(UUID mUuid) {
            this.mUuid = mUuid;
        }

        public String getValue() {
            return mValue;
        }

        public void setValue(String mValue) {
            this.mValue = mValue;
        }

        public int getPermission() {
            return mPermission;
        }

        public void setPermission(int mPermission) {
            this.mPermission = mPermission;
        }

        public int getWriteType() {
            return mWriteType;
        }

        public void setWriteType(int mWriteType) {
            this.mWriteType = mWriteType;
        }

        public List<DescriptorInfo> getDescriptorInfos() {
            return mDescriptorInfos;
        }

        public void setDescriptorInfos(List<DescriptorInfo> mDescriptorInfos) {
            this.mDescriptorInfos = mDescriptorInfos;
        }

        public void setCharacteristic(BleCharacteristicEntity entity){
            this._id = entity.get_id();
            this.mPermission = entity.getPermission();
            this.mServiceId = entity.getServiceId();
            this.mUuid = entity.getUuid();
            this.mValue = entity.getValue();
            this.mWriteType = entity.getWriteType();

        }
    }

    public static class DescriptorInfo {
        private int _id;
        private int mCharacteristicId;
        private UUID mUuid;
        private String mValue;
        private int mPermission;
        private int mWriteType;

        public int get_id() {
            return _id;
        }

        public void set_id(int _id) {
            this._id = _id;
        }

        public int getCharacteristicId() {
            return mCharacteristicId;
        }

        public void setCharacteristicId(int mCharacteristicId) {
            this.mCharacteristicId = mCharacteristicId;
        }

        public UUID getUuid() {
            return mUuid;
        }

        public void setUuid(UUID mUuid) {
            this.mUuid = mUuid;
        }

        public String getValue() {
            return mValue;
        }

        public void setValue(String mValue) {
            this.mValue = mValue;
        }

        public int getPermission() {
            return mPermission;
        }

        public void setPermission(int mPermission) {
            this.mPermission = mPermission;
        }

        public int getWriteType() {
            return mWriteType;
        }

        public void setWriteType(int mWriteType) {
            this.mWriteType = mWriteType;
        }
        public void setDescristor(BleDescriptorEntity entity){
            this._id = entity.get_id();
            this.mCharacteristicId = entity.getCharacteristicId();
            this.mPermission = entity.getPermission();
            this.mUuid = entity.getUuid();
            this.mValue = entity.getValue();
            this.mWriteType = entity.getWriteType();
        }
    }

    public void setBleProduct(BleProductTypeEntity entity){
        this._id = entity.get_id();
        this.mAdvertiseMode = entity.getAdvertiseMode();
        this.mConnectable = entity.isConnectable();
        this.mIsIncludeDeviceName = entity.isIsIncludeDeviceName();
        this.mIsIncludeTxPowerLevel = entity.isIsIncludeTxPowerLevel();
        this.mManufacturerId = entity.getManufacturerId();
        this.mTimeout = entity.getTimeout();
        this.mTxPowerLevel = entity.getTxPowerLevel();
        this.mManufacturerValue = entity.getManufacturerValue();
    }

}
